#include "imu901.h"

extern UART_HandleTypeDef huart1;

void imu901_init(void)
{
	uint8_t data[6]={0};
	//setting LED
	data[0]=0x55;
	data[1]=0xaf;
	data[2]=0x0f;
	data[3]=1;
	data[4]=0; //0:on 1:0ff
	for(uint8_t i=0;i<5;i++)
	{
		data[5]+=data[i];
	}
	HAL_UART_Transmit(&huart1,data,6,500);
	
	//setting ASM
	data[0]=0x55;
	data[1]=0xaf;
	data[2]=0x0c;
	data[3]=1;
	data[4]=0; //0:h 1:v
	for(uint8_t i=0;i<5;i++)
	{
		data[5]+=data[i];
	}	
	HAL_UART_Transmit(&huart1,data,6,500);
	
}
